package com.haoran.dwz;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import com.haoran.dwz.initilizer.ConsulPropertySourceInitilizer;
import com.haoran.dwz.listener.ConsulRegisterListener;

import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@EnableSwagger2
public class DwzConfigApplication {

	public static void main(String[] args) {
		
//		ConfigurableApplicationContext run = SpringApplication.run(KyeApplication.class, args);
		
		/*
		 * 如果有启动监听器就使用以下代码
		 */
		SpringApplication sa = new SpringApplication(DwzConfigApplication.class);
		sa.addListeners(new ConsulRegisterListener());
		sa.addInitializers(new ConsulPropertySourceInitilizer());
		sa.run(args);
	}
}
 
